{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Using CReM in combination with machine learning models\n",
    "\n",
    "This tutorial will exemplify the use of CReM in combination with machine learning models in optimization of a randomly chosen initial structure to a structure having high predicted end-point value. You may choose another starting molecule and look at the output."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "RDKit WARNING: [11:38:12] Enabling RDKit 2019.09.3 jupyter extensions\n"
     ]
    }
   ],
   "source": [
    "from rdkit import Chem\n",
    "from rdkit.Chem import AllChem\n",
    "from rdkit.Chem import Draw, DataStructs\n",
    "from rdkit.Chem.Draw import rdMolDraw2D\n",
    "from rdkit.Chem.Draw import IPythonConsole\n",
    "from IPython.display import SVG, Image\n",
    "IPythonConsole.molSize = (400,300)\n",
    "IPythonConsole.ipython_useSVG=True\n",
    "\n",
    "from crem.crem import mutate_mol\n",
    "\n",
    "import numpy as np\n",
    "from sklearn.ensemble import RandomForestRegressor"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# auxiliary functions to draw molecules with highlighting atoms \n",
    "def drawsvg(mol, highlightAtoms=[], highlightReplacement=False, molSize=(400, 300), kekulize=True):\n",
    "    mc = Chem.Mol(mol.ToBinary())\n",
    "    if kekulize:\n",
    "        try:\n",
    "            Chem.Kekulize(mc)\n",
    "        except:\n",
    "            mc = Chem.Mol(mol.ToBinary())\n",
    "    if not mc.GetNumConformers():\n",
    "        AllChem.Compute2DCoords(mc)\n",
    "    if highlightReplacement:\n",
    "        ids = []\n",
    "        for a in mol.GetAtoms():\n",
    "            if 'react_atom_idx' not in a.GetPropsAsDict():\n",
    "                ids.append(a.GetIdx())\n",
    "        if ids:\n",
    "            highlightAtoms = ids\n",
    "    drawer = rdMolDraw2D.MolDraw2DSVG(molSize[0], molSize[1])\n",
    "    drawer.DrawMolecule(mc, highlightAtoms=highlightAtoms)\n",
    "    drawer.FinishDrawing()\n",
    "    svg = drawer.GetDrawingText()\n",
    "    return SVG(svg.replace('svg:',''))\n",
    "\n",
    "\n",
    "def drawgrid(mols, highlight=0):\n",
    "    \"\"\"\n",
    "    highlight: 0 - no highlight\n",
    "               1 - highlight changed atoms\n",
    "               2 - highlight unchanged atoms\n",
    "    \"\"\"\n",
    "    if highlight == 0:\n",
    "        return Draw.MolsToGridImage(mols[:8], molsPerRow=4, subImgSize=(300,200), useSVG=True)\n",
    "    else:\n",
    "        ids_list = []\n",
    "        for m in mols:\n",
    "            ids = []\n",
    "            for a in m.GetAtoms():\n",
    "                if 'react_atom_idx' not in a.GetPropsAsDict():\n",
    "                    ids.append(a.GetIdx())\n",
    "            if highlight == 1:\n",
    "                ids_list.append(ids)\n",
    "            elif highlight == 2:\n",
    "                ids_list.append(list(set(range(m.GetNumAtoms())) - set(ids)))\n",
    "        return Draw.MolsToGridImage(mols, molsPerRow=4, subImgSize=(300,200), \n",
    "                                    highlightAtomLists=ids_list, useSVG=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def rdkit_numpy_convert(fp):\n",
    "    # fp - list of binary fingerprints\n",
    "    output = []\n",
    "    for f in fp:\n",
    "        arr = np.zeros((1,))\n",
    "        DataStructs.ConvertToNumpyArray(f, arr)\n",
    "        output.append(arr)\n",
    "    return np.asarray(output)\n",
    "\n",
    "def get_top(ms, model):\n",
    "    # ms - list of molecules\n",
    "    # model - sklearn model\n",
    "    fps1 = [AllChem.GetMorganFingerprintAsBitVect(m, 2) for m in ms]\n",
    "    x1 = rdkit_numpy_convert(fps1)\n",
    "    pred = model.predict(x1)\n",
    "    i = np.argmax(pred)\n",
    "    return ms[i], pred[i]\n",
    "\n",
    "def get_sim(ms, ref_fps):\n",
    "    # ms - list of molecules\n",
    "    # ref_fps - list of fingerprints of reference molecules\n",
    "    output = []\n",
    "    fps1 = [AllChem.GetMorganFingerprintAsBitVect(m, 2) for m in ms]\n",
    "    for fp in fps1:\n",
    "        v = DataStructs.BulkTanimotoSimilarity(fp, ref_fps)\n",
    "        i = np.argmax(v)\n",
    "        output.append([v[i], i])\n",
    "    return output"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In this section we will:\n",
    "- load structures of molecules with measured pKi values for histamine H1 receptor.\n",
    "- create Random Forest model based on binary Morgan fingerprints"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "# read file with compounds  and their pKi value for 5-HT1a receptor\n",
    "mols = []\n",
    "names = []\n",
    "y = []\n",
    "with open('CHEMBL231.smi') as f:\n",
    "    for line in f:\n",
    "        smi, name, act = line.strip().split()\n",
    "        m = Chem.MolFromSmiles(smi)\n",
    "        if m:\n",
    "            mols.append(m)\n",
    "            names.append(name)\n",
    "            y.append(float(act))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# create binary Morgan fingeprints and X matrix to train model\n",
    "fps = [AllChem.GetMorganFingerprintAsBitVect(m, 2) for m in mols]\n",
    "x = rdkit_numpy_convert(fps)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "RandomForestRegressor(n_jobs=2, oob_score=True, random_state=42)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# train Random forest model\n",
    "# (here we do not optimize hyperparameters which is required for real use cases, this can be done with for example GridSearchCV)\n",
    "m = RandomForestRegressor(n_estimators=100, n_jobs=2, random_state=42, oob_score=True)\n",
    "m.fit(x, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.7314209965191422"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# out-of-bag score can be considered as a measure of predictivy of a model\n",
    "# (in real use cases cross-validation or external test set would be preferable)\n",
    "m.oob_score_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's implement a naive gready search algorithm. It will start from a given molecule. On each iteration the input molecule will be mutated using the corresponding CReM function. Activity of derived molecules will be estimated with the previosuly obtained model and the molecule with the highest score will be taken for the next iteration. The procedure will be reapeated until the improvement in the predicted end-point value will be observed."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# specify the path to the fragment database (replace with your actual path)\n",
    "db_fname = 'replacements02_sc2.db'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAEsCAIAAABi1XKVAAAABmJLR0QA/wD/AP+gvaeTAAAgAElEQVR4nO3de1wU9foH8GdZYLkpN5GLCoJ5Q1FQURQkEc1FFy/geiuIzDRPimYZ9ep3Dnhev/M7eMoOqJVmaXjXFZCLXETNAEUTLyUgBIKIoILc5b67398fY4hktQuzOzuzz/t1/qhxmHmOsZ+d+c73+Q6PEAIIIcQGOkwXgBBCisLAQgixBgYWQog1MLAQQqyBgYUQYg0MLIQQa2BgIYRYAwMLIcQaGFgIIdbAwEIIsQYGFkKINTCwkFaQyWSFhYUymYzpQlC/YGAh7jty5MiUKVNmzJgxePDg4ODgpKSkzs5OpotCfcHD1RoQt+3YsWPr1q2EEGtr68ePH1MbzczMRCJRYGDgvHnzDA0Nma0QKQ4DC3EWIeSTTz7Zvn07j8fbvn371q1b8/Pzk5OTk5KSLl26RO1jaGjo6+srFosXL148cOBAZgtGfwkDC3GTVCpdt27d/v379fX1Dxw4sGrVqp5/eu/evYSEBIlEcvnyZeojYGBg4OXlJRKJVq5cOXjwYIaqRn8BAwtxUEtLi1gsTk1NNTExkUgkQqHwj/asqKiIi4tLTk6+ePGiVCoFAD6f7+HhIRaLly1bZm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CkKJwfBFpmfx8mDkTCgth/HjIysK0YhcMLKRNrlyBV1+FigqYNQuys2HoUKYLQsrBwEJaIyEBZs+G2lpYvBhSUp6vN4DYAwMLaYcDB2DpUmhrg/feg9hYMDRkuiDUF9hLiLTA7dvg6gqEwD//Cf/zP0xXg/oOAwtph+hoMDHBqaFsh4GFEGINHMNCCLEGBhZim48/BhOT3huXLgVX1+f/Sgh8+y24u4OxMZiagq8vpKers0akIhhYiItWr4a1a8HFBWJi4KuvQE8PhELYvZvpslB/YWsO4pzjx+H77yEqCjZterbl9dchOBi2bIHZs8HZmdHiUL/gFRbinOhocHCA9957YeO//gUA9L91CqkXXmEhdmpoeOFfu7qe/UNbG1y7BuvWQa8Xyg8bBpMnQ2ammspDqoGBhViopeX5O6a6TZwIAPD4MchkYG//kp9ycMChd7bDwEIsZGAAqakvbAkPh8bG5//K4738B/9oO2IJDCzEQnw+zJr1whYrq2eBZW0NfD6Ul7/kp8rLYcgQNVSHVAcH3RG3GBqCuzucOQNS6QvbKyrg+nXw9maoLEQPDCzEOZs2QXl57weCn34KAL0fHSK2wVtCxDkrVkB6Orz/Pty8CX5+0NEBhw9DRgbs2oWTsNgOAwtx0f794OkJe/bAyZOgpwdTpkBaGsybx3RZqL9wtQaEEGvgGBZCiDUwsBBCrIGBhRBiDQwshBBrYGAhhFjj/wHJkJMJlowS3wAAAABJRU5ErkJggg==\n",
      "image/svg+xml": [
       "<?xml version='1.0' encoding='iso-8859-1'?>\n",
       "<svg version='1.1' baseProfile='full'\n",
       "              xmlns='http://www.w3.org/2000/svg'\n",
       "                      xmlns:rdkit='http://www.rdkit.org/xml'\n",
       "                      xmlns:xlink='http://www.w3.org/1999/xlink'\n",
       "                  xml:space='preserve'\n",
       "width='400px' height='300px' viewBox='0 0 400 300'>\n",
       "<!-- END OF HEADER -->\n",
       "<rect style='opacity:1.0;fill:#FFFFFF;stroke:none' width='400' height='300' x='0' y='0'> </rect>\n",
       "<path class='bond-0' d='M 52.3802,101.454 L 59.3994,134.294' style='fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0' d='M 59.3994,134.294 L 66.4186,167.134' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0' d='M 67.0161,98.326 L 74.0353,131.166' style='fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0' d='M 74.0353,131.166 L 81.0545,164.006' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-1' d='M 73.7365,165.57 L 18.1818,215.705' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2' d='M 73.7365,165.57 L 105.832,175.958' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2' d='M 105.832,175.958 L 137.928,186.346' style='fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-3' d='M 151.937,182.292 L 176.212,160.385' style='fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-3' d='M 176.212,160.385 L 200.487,138.478' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4' d='M 200.487,138.478 L 184.846,65.2984' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4' d='M 212.777,124.373 L 201.828,73.1471' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-12' d='M 200.487,138.478 L 271.683,161.522' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-5' d='M 184.846,65.2984 L 240.401,15.1627' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-6' d='M 240.401,15.1627 L 311.597,38.2067' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-6' d='M 246.471,32.8586 L 296.309,48.9893' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-7' d='M 311.597,38.2067 L 327.238,111.386' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-8' d='M 327.238,111.386 L 271.683,161.522' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-8' d='M 308.878,107.796 L 269.99,142.891' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-9' d='M 271.683,161.522 L 287.325,234.702' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-10' d='M 285.02,241.821 L 317.116,252.21' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-10' d='M 317.116,252.21 L 349.212,262.598' style='fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-10' d='M 289.629,227.582 L 321.725,237.97' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-10' d='M 321.725,237.97 L 353.821,248.359' style='fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-11' d='M 287.325,234.702 L 263.703,256.019' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-11' d='M 263.703,256.019 L 240.081,277.337' style='fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<text x='51.0903' y='99.8901' style='font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000' ><tspan>O</tspan></text>\n",
       "<text x='137.928' y='196.114' style='font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000' ><tspan>O</tspan></text>\n",
       "<text x='351.516' y='265.246' style='font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000' ><tspan>O</tspan></text>\n",
       "<text x='218.265' y='292.337' style='font-size:15px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000' ><tspan>HO</tspan></text>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x7f6807065120>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# let's start from aspirin\n",
    "mol = Chem.MolFromSmiles('O=C(C)Oc1ccccc1C(=O)O')\n",
    "mol"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "6.02255"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# estimate end-point value for aspirin\n",
    "get_top([mol], m)[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "molecules generated: 489\n",
      "best score: 8.272\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<svg baseProfile=\"full\" height=\"300px\" version=\"1.1\" viewBox=\"0 0 400 300\" width=\"400px\" xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<!-- END OF HEADER -->\n",
       "<rect height=\"300\" style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"400\" x=\"0\" y=\"0\"> </rect>\n",
       "<path d=\"M 32.5702,183.676 L 77.0295,153.104\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 77.0295,153.104 L 72.7825,99.3146\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 77.0295,153.104 L 125.736,176.32\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 125.736,176.32 L 170.195,145.748\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"32.5702\" cy=\"183.676\" rx=\"14.3884\" ry=\"14.3884\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"77.0295\" cy=\"153.104\" rx=\"14.3884\" ry=\"14.3884\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"72.7825\" cy=\"99.3146\" rx=\"14.3884\" ry=\"14.3884\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"125.736\" cy=\"176.32\" rx=\"14.3884\" ry=\"14.3884\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"170.195\" cy=\"145.748\" rx=\"14.3884\" ry=\"14.3884\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 32.5702,183.676 L 50.9026,171.07\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 50.9026,171.07 L 69.2351,158.464\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 76.3195,144.111 L 74.551,121.713\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 74.551,121.713 L 72.7825,99.3146\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2\" d=\"M 84.824,156.819 L 105.28,166.57\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2\" d=\"M 105.28,166.57 L 125.736,176.32\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 125.736,176.32 L 170.195,145.748\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4\" d=\"M 170.195,145.748 L 190.349,155.354\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4\" d=\"M 190.349,155.354 L 210.502,164.961\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5\" d=\"M 227.3,163.189 L 245.33,150.79\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5\" d=\"M 245.33,150.79 L 263.361,138.392\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 263.361,138.392 L 259.114,84.6026\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 273.481,129.474 L 270.508,91.8215\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-8\" d=\"M 263.361,138.392 L 312.067,161.608\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-6\" d=\"M 259.114,84.6026 L 303.573,54.03\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-11\" d=\"M 303.573,54.03 L 352.279,77.2465\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-11\" d=\"M 306.236,67.2537 L 340.33,83.5053\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-9\" d=\"M 312.067,161.608 L 316.314,215.397\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 312.067,161.608 L 356.526,131.036\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 312.621,148.131 L 343.743,126.73\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 313.992,220.268 L 334.146,229.875\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 334.146,229.875 L 354.3,239.481\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 318.636,210.527 L 338.789,220.133\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 338.789,220.133 L 358.943,229.74\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 316.314,215.397 L 300.623,226.187\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 300.623,226.187 L 284.932,236.977\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 356.526,131.036 L 352.279,77.2465\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<text style=\"font-size:17px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF\" x=\"69.2351\" y=\"162.097\"><tspan>N</tspan></text>\n",
       "<text style=\"font-size:17px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"210.502\" y=\"177.957\"><tspan>O</tspan></text>\n",
       "<text style=\"font-size:17px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"356.621\" y=\"247.607\"><tspan>O</tspan></text>\n",
       "<text style=\"font-size:17px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"255.661\" y=\"254.963\"><tspan>HO</tspan></text>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# iteration 1\n",
    "new_mols = list(mutate_mol(Chem.AddHs(mol), db_name=db_fname, return_mol=True, min_size=0, max_size=8, min_inc=-3, max_inc=3, ncores=4))\n",
    "new_mols = [Chem.RemoveHs(i[1]) for i in new_mols]\n",
    "best_mol, score = get_top(new_mols + [mol], m)\n",
    "print('molecules generated:', len(new_mols))\n",
    "print('best score:', np.round(score, 3))\n",
    "drawsvg(best_mol, highlightReplacement=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "molecules generated: 711\n",
      "best score: 8.533\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<svg baseProfile=\"full\" height=\"300px\" version=\"1.1\" viewBox=\"0 0 400 300\" width=\"400px\" xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<!-- END OF HEADER -->\n",
       "<rect height=\"300\" style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"400\" x=\"0\" y=\"0\"> </rect>\n",
       "<path d=\"M 315.379,250.344 L 280.303,210.206\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 280.303,210.206 L 228.005,220.514\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 280.303,210.206 L 297.525,159.761\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 228.005,220.514 L 210.783,270.959\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 297.525,159.761 L 262.449,119.624\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 262.449,119.624 L 210.151,129.931\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 262.449,119.624 L 279.671,69.1783\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 210.151,129.931 L 175.076,89.7938\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 175.076,89.7938 L 192.298,39.3486\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 192.298,39.3486 L 244.596,29.0408\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 244.596,29.0408 L 279.671,69.1783\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"315.379\" cy=\"250.344\" rx=\"14.2144\" ry=\"14.2144\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"280.303\" cy=\"210.206\" rx=\"14.2144\" ry=\"14.2144\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"228.005\" cy=\"220.514\" rx=\"14.2144\" ry=\"14.2144\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"210.783\" cy=\"270.959\" rx=\"14.2144\" ry=\"14.2144\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"297.525\" cy=\"159.761\" rx=\"14.2144\" ry=\"14.2144\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"262.449\" cy=\"119.624\" rx=\"14.2144\" ry=\"14.2144\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"210.151\" cy=\"129.931\" rx=\"14.2144\" ry=\"14.2144\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"175.076\" cy=\"89.7938\" rx=\"14.2144\" ry=\"14.2144\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"192.298\" cy=\"39.3486\" rx=\"14.2144\" ry=\"14.2144\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"244.596\" cy=\"29.0408\" rx=\"14.2144\" ry=\"14.2144\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"279.671\" cy=\"69.1783\" rx=\"14.2144\" ry=\"14.2144\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 319.392,246.836 L 284.317,206.699\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 311.365,253.851 L 276.289,213.714\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-6\" d=\"M 280.303,210.206 L 228.005,220.514\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 280.303,210.206 L 297.525,159.761\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 222.96,218.792 L 215.866,239.572\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 215.866,239.572 L 208.771,260.353\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 233.049,222.236 L 225.955,243.017\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 225.955,243.017 L 218.86,263.797\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2\" d=\"M 228.005,220.514 L 214.349,204.887\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2\" d=\"M 214.349,204.887 L 200.693,189.26\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 184.632,182.012 L 162.631,186.348\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 162.631,186.348 L 140.631,190.684\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4\" d=\"M 140.631,190.684 L 105.555,150.547\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5\" d=\"M 105.555,150.547 L 83.2566,154.942\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5\" d=\"M 83.2566,154.942 L 60.9578,159.337\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 45.5574,152.043 L 31.8696,136.38\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 31.8696,136.38 L 18.1818,120.717\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 50.2245,169.739 L 43.13,190.519\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 43.13,190.519 L 36.0354,211.3\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 297.525,159.761 L 262.449,119.624\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 297.525,159.761 L 315.675,156.184\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 315.675,156.184 L 333.825,152.606\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-8\" d=\"M 262.449,119.624 L 210.151,129.931\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-8\" d=\"M 252.543,110.71 L 215.934,117.926\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-15\" d=\"M 262.449,119.624 L 279.671,69.1783\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-9\" d=\"M 210.151,129.931 L 175.076,89.7938\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 175.076,89.7938 L 182.17,69.0132\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 182.17,69.0132 L 189.265,48.2326\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 187.293,87.0041 L 192.259,72.4577\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 192.259,72.4577 L 197.225,57.9112\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-11\" d=\"M 199.998,37.8309 L 222.297,33.4359\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-11\" d=\"M 222.297,33.4359 L 244.596,29.0408\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 244.596,29.0408 L 279.671,69.1783\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 241.83,42.0766 L 266.383,70.1728\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<text style=\"font-size:17px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"202.485\" y=\"279.843\"><tspan>O</tspan></text>\n",
       "<text style=\"font-size:17px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"184.632\" y=\"189.26\"><tspan>O</tspan></text>\n",
       "<text style=\"font-size:17px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF\" x=\"45.5574\" y=\"169.739\"><tspan>N</tspan></text>\n",
       "<text style=\"font-size:17px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF\" x=\"184.598\" y=\"48.2326\"><tspan>N</tspan></text>\n",
       "<text style=\"font-size:17px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"333.825\" y=\"158.337\"><tspan>OH</tspan></text>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# iteration 2\n",
    "mol = best_mol\n",
    "new_mols = list(mutate_mol(Chem.AddHs(mol), db_name=db_fname, return_mol=True, min_size=0, max_size=8, min_inc=-3, max_inc=3, ncores=4))\n",
    "new_mols = [Chem.RemoveHs(i[1]) for i in new_mols]\n",
    "best_mol, score = get_top(new_mols + [mol], m)\n",
    "print('molecules generated:', len(new_mols))\n",
    "print('best score:', np.round(score, 3))\n",
    "drawsvg(best_mol, highlightReplacement=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "molecules generated: 512\n",
      "best score: 8.666\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<svg baseProfile=\"full\" height=\"300px\" version=\"1.1\" viewBox=\"0 0 400 300\" width=\"400px\" xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<!-- END OF HEADER -->\n",
       "<rect height=\"300\" style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"400\" x=\"0\" y=\"0\"> </rect>\n",
       "<path d=\"M 110.663,204.567 L 114.7,167.177\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 114.7,167.177 L 149.099,151.978\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 149.099,151.978 L 179.461,174.169\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 149.099,151.978 L 153.136,114.588\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 179.461,174.169 L 213.86,158.971\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 213.86,158.971 L 217.897,121.581\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 217.897,121.581 L 187.535,99.3898\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 187.535,99.3898 L 153.136,114.588\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:16px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"110.663\" cy=\"204.567\" rx=\"10.0286\" ry=\"10.0286\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"114.7\" cy=\"167.177\" rx=\"10.0286\" ry=\"10.0286\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"149.099\" cy=\"151.978\" rx=\"10.0286\" ry=\"10.0286\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"179.461\" cy=\"174.169\" rx=\"10.0286\" ry=\"10.0286\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"213.86\" cy=\"158.971\" rx=\"10.0286\" ry=\"10.0286\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"217.897\" cy=\"121.581\" rx=\"10.0286\" ry=\"10.0286\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"187.535\" cy=\"99.3898\" rx=\"10.0286\" ry=\"10.0286\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"153.136\" cy=\"114.588\" rx=\"10.0286\" ry=\"10.0286\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 115.079,198.702 L 116.421,186.275\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 116.421,186.275 L 117.762,173.848\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 107.601,197.895 L 108.943,185.468\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 108.943,185.468 L 110.284,173.041\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 119.719,164.959 L 134.409,158.469\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 134.409,158.469 L 149.099,151.978\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-11\" d=\"M 109.681,163.509 L 97.0098,154.247\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-11\" d=\"M 97.0098,154.247 L 84.3383,144.986\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 149.099,151.978 L 179.461,174.169\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 158.092,149.234 L 179.345,164.768\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 149.099,151.978 L 153.136,114.588\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2\" d=\"M 179.461,174.169 L 213.86,158.971\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 213.86,158.971 L 217.897,121.581\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 206.988,152.555 L 209.814,126.382\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 217.897,121.581 L 232.17,115.275\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 232.17,115.275 L 246.442,108.969\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-8\" d=\"M 217.897,121.581 L 187.535,99.3898\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4\" d=\"M 258.15,110.661 L 270.404,119.617\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4\" d=\"M 270.404,119.617 L 282.658,128.573\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5\" d=\"M 282.658,128.573 L 317.057,113.375\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-6\" d=\"M 317.057,113.375 L 329.522,122.485\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-6\" d=\"M 329.522,122.485 L 341.987,131.595\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-19\" d=\"M 352.852,133.166 L 367.335,126.766\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-19\" d=\"M 367.335,126.766 L 381.818,120.367\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-20\" d=\"M 346.742,141.834 L 345.062,157.395\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-20\" d=\"M 345.062,157.395 L 343.382,172.956\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-9\" d=\"M 187.535,99.3898 L 153.136,114.588\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-9\" d=\"M 185.415,108.549 L 161.336,119.188\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 84.3383,144.986 L 88.3754,107.596\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 77.4659,138.57 L 80.2919,112.397\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-18\" d=\"M 84.3383,144.986 L 49.9393,160.184\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 88.3754,107.596 L 58.0135,85.4049\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 58.0135,85.4049 L 43.5303,91.804\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 43.5303,91.804 L 29.0471,98.2032\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 56.7082,94.2044 L 46.57,98.6838\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 46.57,98.6838 L 36.4318,103.163\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-15\" d=\"M 22.9377,106.871 L 21.2575,122.432\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-15\" d=\"M 21.2575,122.432 L 19.5773,137.993\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 19.5773,137.993 L 49.9393,160.184\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 28.5699,135.25 L 49.8232,150.783\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<text style=\"font-size:12px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"104.809\" y=\"210.834\"><tspan>O</tspan></text>\n",
       "<text style=\"font-size:12px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00\" x=\"109.681\" y=\"173.445\"><tspan>S</tspan></text>\n",
       "<text style=\"font-size:12px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"246.442\" y=\"112.65\"><tspan>O</tspan></text>\n",
       "<text style=\"font-size:12px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF\" x=\"341.987\" y=\"141.834\"><tspan>N</tspan></text>\n",
       "<text style=\"font-size:12px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF\" x=\"18.1818\" y=\"106.871\"><tspan>N</tspan></text>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# iteration 3\n",
    "mol = best_mol\n",
    "new_mols = list(mutate_mol(Chem.AddHs(mol), db_name=db_fname, return_mol=True, min_size=0, max_size=8, min_inc=-3, max_inc=3, ncores=4))\n",
    "new_mols = [Chem.RemoveHs(i[1]) for i in new_mols]\n",
    "best_mol, score = get_top(new_mols + [mol], m)\n",
    "print('molecules generated:', len(new_mols))\n",
    "print('best score:', np.round(score, 3))\n",
    "drawsvg(best_mol, highlightReplacement=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "molecules generated: 6159\n",
      "best score: 8.781\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<svg baseProfile=\"full\" height=\"300px\" version=\"1.1\" viewBox=\"0 0 400 300\" width=\"400px\" xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<!-- END OF HEADER -->\n",
       "<rect height=\"300\" style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"400\" x=\"0\" y=\"0\"> </rect>\n",
       "<path d=\"M 349.151,199.813 L 371.837,170.043\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:15px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 349.151,199.813 L 313.827,187.436\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:15px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 371.837,170.043 L 350.535,139.268\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:15px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 350.535,139.268 L 314.683,150.017\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:15px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 314.683,150.017 L 313.827,187.436\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:15px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"349.151\" cy=\"199.813\" rx=\"9.98102\" ry=\"9.98102\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"371.837\" cy=\"170.043\" rx=\"9.98102\" ry=\"9.98102\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"350.535\" cy=\"139.268\" rx=\"9.98102\" ry=\"9.98102\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"314.683\" cy=\"150.017\" rx=\"9.98102\" ry=\"9.98102\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"313.827\" cy=\"187.436\" rx=\"9.98102\" ry=\"9.98102\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 349.151,199.813 L 371.837,170.043\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 346.6,190.81 L 362.48,169.971\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-11\" d=\"M 349.151,199.813 L 313.827,187.436\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 371.837,170.043 L 363.345,157.774\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 363.345,157.774 L 354.853,145.506\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2\" d=\"M 345.54,140.765 L 330.111,145.391\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2\" d=\"M 330.111,145.391 L 314.683,150.017\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-9\" d=\"M 314.683,150.017 L 302.295,140.577\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-9\" d=\"M 302.295,140.577 L 289.908,131.137\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 314.683,150.017 L 313.827,187.436\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 322.038,155.801 L 321.44,181.994\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 289.426,121.569 L 291.007,109.245\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 291.007,109.245 L 292.587,96.9204\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 282.001,120.616 L 283.582,108.292\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 283.582,108.292 L 285.163,95.968\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4\" d=\"M 279.918,129.419 L 265.15,135.594\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4\" d=\"M 265.15,135.594 L 250.381,141.769\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-6\" d=\"M 250.381,141.769 L 245.619,178.894\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 250.381,141.769 L 220.611,119.083\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 241.378,144.32 L 220.54,128.439\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5\" d=\"M 245.619,178.894 L 211.087,193.332\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5\" d=\"M 237.552,174.153 L 213.379,184.26\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 211.087,193.332 L 181.317,170.645\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-8\" d=\"M 220.611,119.083 L 186.079,133.521\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 186.079,133.521 L 181.317,170.645\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 192.79,140.042 L 189.457,166.029\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 181.317,170.645 L 166.964,176.646\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 166.964,176.646 L 152.612,182.648\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-15\" d=\"M 140.959,180.644 L 128.987,171.52\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-15\" d=\"M 128.987,171.52 L 117.016,162.397\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 117.016,162.397 L 82.4836,176.835\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 82.4836,176.835 L 70.3021,167.552\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 70.3021,167.552 L 58.1206,158.269\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-18\" d=\"M 47.3069,156.41 L 32.7443,162.498\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-18\" d=\"M 32.7443,162.498 L 18.1818,168.587\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-19\" d=\"M 53.5139,147.911 L 55.4949,132.468\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-19\" d=\"M 55.4949,132.468 L 57.4759,117.024\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<text style=\"font-size:12px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00\" x=\"345.54\" y=\"145.506\"><tspan>S</tspan></text>\n",
       "<text style=\"font-size:12px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00\" x=\"279.918\" y=\"133.569\"><tspan>S</tspan></text>\n",
       "<text style=\"font-size:12px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"283.849\" y=\"96.4442\"><tspan>O</tspan></text>\n",
       "<text style=\"font-size:12px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"140.959\" y=\"191.322\"><tspan>O</tspan></text>\n",
       "<text style=\"font-size:12px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF\" x=\"47.3069\" y=\"160.387\"><tspan>N</tspan></text>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# iteration 4\n",
    "mol = best_mol\n",
    "new_mols = list(mutate_mol(Chem.AddHs(mol), db_name=db_fname, return_mol=True, min_size=0, max_size=8, min_inc=-3, max_inc=3, ncores=4))\n",
    "new_mols = [Chem.RemoveHs(i[1]) for i in new_mols]\n",
    "best_mol, score = get_top(new_mols + [mol], m)\n",
    "print('molecules generated:', len(new_mols))\n",
    "print('best score:', np.round(score, 3))\n",
    "drawsvg(best_mol, highlightReplacement=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "molecules generated: 5090\n",
      "best score: 8.842\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<svg baseProfile=\"full\" height=\"300px\" version=\"1.1\" viewBox=\"0 0 400 300\" width=\"400px\" xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<!-- END OF HEADER -->\n",
       "<rect height=\"300\" style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"400\" x=\"0\" y=\"0\"> </rect>\n",
       "<path d=\"M 139.765,157.31 L 167.049,180.249\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:15px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"139.765\" cy=\"157.31\" rx=\"9.50545\" ry=\"9.50545\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"167.049\" cy=\"180.249\" rx=\"9.50545\" ry=\"9.50545\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-6\" d=\"M 139.765,157.31 L 151.029,166.78\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-6\" d=\"M 151.029,166.78 L 162.292,176.249\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 139.765,157.31 L 106.258,169.47\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 171.806,178.522 L 186.181,173.306\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 186.181,173.306 L 200.557,168.089\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 200.557,168.089 L 206.78,132.991\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 208.51,164.069 L 212.866,139.5\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 200.557,168.089 L 227.841,191.027\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2\" d=\"M 206.78,132.991 L 240.287,120.831\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 240.287,120.831 L 267.571,143.769\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 239.792,129.729 L 258.891,145.785\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4\" d=\"M 267.571,143.769 L 261.348,178.867\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 267.571,143.769 L 281.946,138.553\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 281.946,138.553 L 296.321,133.336\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5\" d=\"M 261.348,178.867 L 227.841,191.027\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5\" d=\"M 253.89,173.99 L 230.435,182.502\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-8\" d=\"M 106.258,169.47 L 78.9734,146.532\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-9\" d=\"M 78.9734,146.532 L 64.7944,151.677\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-9\" d=\"M 64.7944,151.677 L 50.6154,156.823\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 40.3169,154.363 L 29.2493,145.058\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 29.2493,145.058 L 18.1818,135.753\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-11\" d=\"M 44.4128,164.633 L 41.828,179.211\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-11\" d=\"M 41.828,179.211 L 39.2431,193.79\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 305.642,126.291 L 307.7,114.683\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 307.7,114.683 L 309.758,103.075\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 298.622,125.046 L 300.68,113.438\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 300.68,113.438 L 302.738,101.83\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-15\" d=\"M 305.836,135.609 L 317.099,145.078\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-15\" d=\"M 317.099,145.078 L 328.363,154.548\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 328.363,154.548 L 343.282,150.843\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 343.282,150.843 L 358.201,147.138\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 328.363,154.548 L 325.843,190.104\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 335.096,160.385 L 333.332,185.275\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-18\" d=\"M 366.662,151.898 L 374.24,164.051\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-18\" d=\"M 374.24,164.051 L 381.818,176.204\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-19\" d=\"M 325.843,190.104 L 358.88,203.488\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-20\" d=\"M 381.818,176.204 L 358.88,203.488\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-20\" d=\"M 372.921,175.709 L 356.864,194.808\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<text style=\"font-size:11px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00\" x=\"162.292\" y=\"186.19\"><tspan>S</tspan></text>\n",
       "<text style=\"font-size:11px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF\" x=\"40.3169\" y=\"164.633\"><tspan>N</tspan></text>\n",
       "<text style=\"font-size:11px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00\" x=\"296.321\" y=\"137.551\"><tspan>S</tspan></text>\n",
       "<text style=\"font-size:11px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"301.753\" y=\"102.452\"><tspan>O</tspan></text>\n",
       "<text style=\"font-size:11px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00\" x=\"358.201\" y=\"151.898\"><tspan>S</tspan></text>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# iteration 5\n",
    "mol = best_mol\n",
    "new_mols = list(mutate_mol(Chem.AddHs(mol), db_name=db_fname, return_mol=True, min_size=0, max_size=8, min_inc=-3, max_inc=3, ncores=4))\n",
    "new_mols = [Chem.RemoveHs(i[1]) for i in new_mols]\n",
    "best_mol, score = get_top(new_mols + [mol], m)\n",
    "print('molecules generated:', len(new_mols))\n",
    "print('best score:', np.round(score, 3))\n",
    "drawsvg(best_mol, highlightReplacement=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "molecules generated: 6106\n",
      "best score: 8.888\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<svg baseProfile=\"full\" height=\"300px\" version=\"1.1\" viewBox=\"0 0 400 300\" width=\"400px\" xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<!-- END OF HEADER -->\n",
       "<rect height=\"300\" style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"400\" x=\"0\" y=\"0\"> </rect>\n",
       "<path d=\"M 164.04,178.869 L 141.098,162.465\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:12px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 164.04,178.869 L 189.718,167.203\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:12px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 189.718,167.203 L 212.66,183.607\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:12px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"164.04\" cy=\"178.869\" rx=\"7.52092\" ry=\"7.52092\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"141.098\" cy=\"162.465\" rx=\"7.52092\" ry=\"7.52092\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"189.718\" cy=\"167.203\" rx=\"7.52092\" ry=\"7.52092\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"212.66\" cy=\"183.607\" rx=\"7.52092\" ry=\"7.52092\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4\" d=\"M 165.681,176.575 L 139.458,164.759\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4\" d=\"M 162.4,181.163 L 142.739,160.17\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5\" d=\"M 164.04,178.869 L 189.718,167.203\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 141.098,162.465 L 115.421,174.131\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 115.421,174.131 L 92.4789,157.726\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2\" d=\"M 92.4789,157.726 L 66.8013,169.392\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 66.8013,169.392 L 57.3674,162.647\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 57.3674,162.647 L 47.9336,155.901\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 39.7852,154.839 L 28.9835,159.747\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 28.9835,159.747 L 18.1818,164.654\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-15\" d=\"M 44.3175,148.288 L 45.4562,136.603\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-15\" d=\"M 45.4562,136.603 L 46.595,124.918\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-6\" d=\"M 189.718,167.203 L 198.994,173.835\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-6\" d=\"M 198.994,173.835 L 208.27,180.468\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 217.05,181.612 L 227.694,176.777\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 227.694,176.777 L 238.337,171.941\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-8\" d=\"M 238.337,171.941 L 241.073,143.87\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-8\" d=\"M 244.362,168.277 L 246.277,148.628\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 238.337,171.941 L 261.279,188.345\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-9\" d=\"M 241.073,143.87 L 266.751,132.204\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 266.751,132.204 L 289.692,148.609\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 266.911,139.253 L 282.97,150.736\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-11\" d=\"M 289.692,148.609 L 286.957,176.679\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 289.692,148.609 L 300.649,143.631\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 300.649,143.631 L 311.606,138.653\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 286.957,176.679 L 261.279,188.345\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 280.772,173.294 L 262.798,181.46\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 318.635,132.515 L 319.545,123.181\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 319.545,123.181 L 320.455,113.846\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 313.021,131.968 L 313.931,122.634\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 313.931,122.634 L 314.84,113.299\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-18\" d=\"M 319.134,139.634 L 328.723,146.49\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-18\" d=\"M 328.723,146.49 L 338.312,153.347\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-19\" d=\"M 338.312,153.347 L 349.808,149.515\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-19\" d=\"M 349.808,149.515 L 361.304,145.683\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-20\" d=\"M 338.312,153.347 L 338.526,181.549\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-20\" d=\"M 343.985,157.535 L 344.134,177.276\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-21\" d=\"M 368.538,149.129 L 375.178,158.124\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-21\" d=\"M 375.178,158.124 L 381.818,167.12\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-22\" d=\"M 338.526,181.549 L 365.414,190.061\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-23\" d=\"M 381.818,167.12 L 365.414,190.061\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-23\" d=\"M 374.769,167.28 L 363.286,183.339\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<text style=\"font-size:9px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF\" x=\"39.7852\" y=\"157.689\"><tspan>N</tspan></text>\n",
       "<text style=\"font-size:9px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"208.27\" y=\"188.308\"><tspan>O</tspan></text>\n",
       "<text style=\"font-size:9px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00\" x=\"311.606\" y=\"141.643\"><tspan>S</tspan></text>\n",
       "<text style=\"font-size:9px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"313.715\" y=\"113.573\"><tspan>O</tspan></text>\n",
       "<text style=\"font-size:9px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00\" x=\"361.304\" y=\"149.129\"><tspan>S</tspan></text>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# iteration 6\n",
    "mol = best_mol\n",
    "new_mols = list(mutate_mol(Chem.AddHs(mol), db_name=db_fname, return_mol=True, min_size=0, max_size=8, min_inc=-3, max_inc=3, ncores=4))\n",
    "new_mols = [Chem.RemoveHs(i[1]) for i in new_mols]\n",
    "best_mol, score = get_top(new_mols + [mol], m)\n",
    "print('molecules generated:', len(new_mols))\n",
    "print('best score:', np.round(score, 3))\n",
    "drawsvg(best_mol, highlightReplacement=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "molecules generated: 4367\n",
      "best score: 8.924\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<svg baseProfile=\"full\" height=\"300px\" version=\"1.1\" viewBox=\"0 0 400 300\" width=\"400px\" xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<!-- END OF HEADER -->\n",
       "<rect height=\"300\" style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"400\" x=\"0\" y=\"0\"> </rect>\n",
       "<ellipse cx=\"198.525\" cy=\"179.786\" rx=\"8.11979\" ry=\"8.11979\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 198.525,179.786 L 174.681,160.849\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4\" d=\"M 198.525,179.786 L 226.847,168.604\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 173.563,158.017 L 147.477,174.863\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 175.799,163.681 L 145.241,169.198\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 146.359,172.031 L 122.514,153.094\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2\" d=\"M 122.514,153.094 L 94.1926,164.276\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-19\" d=\"M 94.1926,164.276 L 70.3481,145.339\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5\" d=\"M 226.847,168.604 L 231.324,138.486\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5\" d=\"M 233.542,164.982 L 236.676,143.899\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 226.847,168.604 L 250.691,187.541\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-6\" d=\"M 231.324,138.486 L 259.646,127.304\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 259.646,127.304 L 283.491,146.241\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 259.436,134.914 L 276.127,148.169\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-8\" d=\"M 283.491,146.241 L 279.013,176.359\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-11\" d=\"M 283.491,146.241 L 295.62,141.452\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-11\" d=\"M 295.62,141.452 L 307.749,136.664\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-9\" d=\"M 279.013,176.359 L 250.691,187.541\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-9\" d=\"M 272.529,172.372 L 252.703,180.199\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 315.579,130.432 L 317.063,120.448\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 317.063,120.448 L 318.547,110.464\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 309.555,129.537 L 311.039,119.553\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 311.039,119.553 L 312.524,109.568\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 315.876,138.287 L 325.767,146.141\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 325.767,146.141 L 335.657,153.996\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 335.657,153.996 L 348.293,150.481\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 348.293,150.481 L 360.929,146.966\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-15\" d=\"M 335.657,153.996 L 334.352,184.417\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-15\" d=\"M 341.546,158.82 L 340.632,180.115\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 368.357,150.911 L 375.088,161.063\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 375.088,161.063 L 381.818,171.214\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 334.352,184.417 L 362.882,195.059\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-18\" d=\"M 381.818,171.214 L 362.882,195.059\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-18\" d=\"M 374.209,171.004 L 360.953,187.695\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-20\" d=\"M 70.3481,145.339 L 58.3865,150.061\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-20\" d=\"M 58.3865,150.061 L 46.4249,154.784\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-21\" d=\"M 37.6276,153.027 L 27.9047,145.306\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-21\" d=\"M 27.9047,145.306 L 18.1818,137.584\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-22\" d=\"M 41.2718,161.595 L 39.4104,174.117\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-22\" d=\"M 39.4104,174.117 L 37.5489,186.639\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<text style=\"font-size:10px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00\" x=\"307.749\" y=\"140.134\"><tspan>S</tspan></text>\n",
       "<text style=\"font-size:10px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"311.55\" y=\"110.016\"><tspan>O</tspan></text>\n",
       "<text style=\"font-size:10px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00\" x=\"360.929\" y=\"150.911\"><tspan>S</tspan></text>\n",
       "<text style=\"font-size:10px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF\" x=\"37.6276\" y=\"161.595\"><tspan>N</tspan></text>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# iteration 7\n",
    "mol = best_mol\n",
    "new_mols = list(mutate_mol(Chem.AddHs(mol), db_name=db_fname, return_mol=True, min_size=0, max_size=8, min_inc=-3, max_inc=3, ncores=4))\n",
    "new_mols = [Chem.RemoveHs(i[1]) for i in new_mols]\n",
    "best_mol, score = get_top(new_mols + [mol], m)\n",
    "print('molecules generated:', len(new_mols))\n",
    "print('best score:', np.round(score, 3))\n",
    "drawsvg(best_mol, highlightReplacement=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "molecules generated: 5574\n",
      "best score: 8.924\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<svg baseProfile=\"full\" height=\"300px\" version=\"1.1\" viewBox=\"0 0 400 300\" width=\"400px\" xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<!-- END OF HEADER -->\n",
       "<rect height=\"300\" style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"400\" x=\"0\" y=\"0\"> </rect>\n",
       "<path d=\"M 66.8013,169.926 L 43.8594,153.521\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:12px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"66.8013\" cy=\"169.926\" rx=\"7.52092\" ry=\"7.52092\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"43.8594\" cy=\"153.521\" rx=\"7.52092\" ry=\"7.52092\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2\" d=\"M 66.8013,169.926 L 57.3674,163.18\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2\" d=\"M 57.3674,163.18 L 47.9336,156.435\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 66.8013,169.926 L 92.4789,158.26\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 39.7852,155.372 L 28.9835,160.28\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 28.9835,160.28 L 18.1818,165.188\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 44.3175,148.821 L 45.4562,137.136\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 45.4562,137.136 L 46.595,125.451\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4\" d=\"M 92.4789,158.26 L 115.421,174.664\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5\" d=\"M 115.421,174.664 L 141.098,162.998\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-6\" d=\"M 141.098,162.998 L 164.04,179.402\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 165.207,181.97 L 188.551,165.168\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 162.874,176.834 L 190.884,170.304\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-8\" d=\"M 189.718,167.736 L 212.66,184.14\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-9\" d=\"M 212.66,184.14 L 238.337,172.474\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 238.337,172.474 L 241.073,144.404\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 244.362,168.811 L 246.277,149.161\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-11\" d=\"M 238.337,172.474 L 261.279,188.879\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 241.073,144.404 L 266.751,132.738\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 261.279,188.879 L 286.957,177.212\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 262.798,181.993 L 280.772,173.827\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 266.751,132.738 L 289.692,149.142\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 266.911,139.787 L 282.97,151.27\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-15\" d=\"M 286.957,177.212 L 289.692,149.142\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 289.692,149.142 L 300.649,144.164\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 300.649,144.164 L 311.606,139.186\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 318.635,133.049 L 319.545,123.714\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 319.545,123.714 L 320.455,114.379\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 313.021,132.502 L 313.931,123.167\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 313.931,123.167 L 314.84,113.832\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-18\" d=\"M 319.134,140.167 L 328.723,147.024\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-18\" d=\"M 328.723,147.024 L 338.312,153.88\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-19\" d=\"M 338.312,153.88 L 349.808,150.048\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-19\" d=\"M 349.808,150.048 L 361.304,146.216\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-20\" d=\"M 338.312,153.88 L 338.526,182.083\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-20\" d=\"M 343.985,158.068 L 344.134,177.81\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-21\" d=\"M 368.538,149.662 L 375.178,158.658\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-21\" d=\"M 375.178,158.658 L 381.818,167.653\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-22\" d=\"M 338.526,182.083 L 365.414,190.595\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-23\" d=\"M 381.818,167.653 L 365.414,190.595\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-23\" d=\"M 374.769,167.813 L 363.286,183.873\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<text style=\"font-size:9px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF\" x=\"39.7852\" y=\"158.222\"><tspan>N</tspan></text>\n",
       "<text style=\"font-size:9px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00\" x=\"311.606\" y=\"142.176\"><tspan>S</tspan></text>\n",
       "<text style=\"font-size:9px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"313.715\" y=\"114.106\"><tspan>O</tspan></text>\n",
       "<text style=\"font-size:9px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00\" x=\"361.304\" y=\"149.662\"><tspan>S</tspan></text>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# iteration 8\n",
    "mol = best_mol\n",
    "new_mols = list(mutate_mol(Chem.AddHs(mol), db_name=db_fname, return_mol=True, min_size=0, max_size=8, min_inc=-3, max_inc=3, ncores=4))\n",
    "new_mols = [Chem.RemoveHs(i[1]) for i in new_mols]\n",
    "best_mol, score = get_top(new_mols + [mol], m)\n",
    "print('molecules generated:', len(new_mols))\n",
    "print('best score:', np.round(score, 3))\n",
    "drawsvg(best_mol, highlightReplacement=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "molecules generated: 4579\n",
      "best score: 8.951\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<svg baseProfile=\"full\" height=\"300px\" version=\"1.1\" viewBox=\"0 0 400 300\" width=\"400px\" xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<!-- END OF HEADER -->\n",
       "<rect height=\"300\" style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"400\" x=\"0\" y=\"0\"> </rect>\n",
       "<path d=\"M 146.968,174.263 L 126.554,160.051\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:10px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path d=\"M 146.968,174.263 L 169.483,163.69\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:10px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"146.968\" cy=\"174.263\" rx=\"6.63301\" ry=\"6.63301\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"126.554\" cy=\"160.051\" rx=\"6.63301\" ry=\"6.63301\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"169.483\" cy=\"163.69\" rx=\"6.63301\" ry=\"6.63301\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4\" d=\"M 148.389,172.222 L 125.133,162.093\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4\" d=\"M 145.547,176.305 L 127.975,158.01\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5\" d=\"M 146.968,174.263 L 169.483,163.69\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 126.554,160.051 L 104.039,170.625\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 104.039,170.625 L 83.6253,156.413\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2\" d=\"M 83.6253,156.413 L 61.1105,166.986\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 61.1105,166.986 L 52.7002,161.131\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 52.7002,161.131 L 44.2898,155.276\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-24\" d=\"M 37.1034,154.462 L 27.6426,158.904\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-24\" d=\"M 27.6426,158.904 L 18.1818,163.347\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-25\" d=\"M 41.048,148.628 L 41.9227,138.309\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-25\" d=\"M 41.9227,138.309 L 42.7974,127.989\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-6\" d=\"M 169.483,163.69 L 189.897,177.902\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 190.954,180.153 L 211.354,165.077\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 188.839,175.65 L 213.469,169.58\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-8\" d=\"M 212.411,167.329 L 232.825,181.541\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-9\" d=\"M 232.825,181.541 L 255.34,170.968\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 255.34,170.968 L 257.441,146.183\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 260.612,167.67 L 262.083,150.321\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-11\" d=\"M 255.34,170.968 L 275.754,185.179\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 257.441,146.183 L 279.956,135.61\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 275.754,185.179 L 298.269,174.606\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 277.017,179.09 L 292.777,171.689\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 279.956,135.61 L 300.37,149.821\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 280.175,141.824 L 294.465,151.772\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-15\" d=\"M 298.269,174.606 L 300.37,149.821\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 300.37,149.821 L 309.967,145.314\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 309.967,145.314 L 319.565,140.807\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 325.714,135.313 L 326.413,127.066\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 326.413,127.066 L 327.112,118.819\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 320.757,134.893 L 321.456,126.646\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 321.456,126.646 L 322.155,118.399\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-18\" d=\"M 326.204,141.559 L 334.751,147.51\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-18\" d=\"M 334.751,147.51 L 343.298,153.46\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-19\" d=\"M 343.298,153.46 L 353.387,149.956\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-19\" d=\"M 353.387,149.956 L 363.476,146.451\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-20\" d=\"M 343.298,153.46 L 343.8,178.329\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-20\" d=\"M 348.347,157.09 L 348.698,174.498\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-21\" d=\"M 369.937,149.444 L 375.877,157.283\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-21\" d=\"M 375.877,157.283 L 381.818,165.123\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-22\" d=\"M 343.8,178.329 L 367.606,185.537\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-23\" d=\"M 381.818,165.123 L 367.606,185.537\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-23\" d=\"M 375.604,165.342 L 365.655,179.632\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<text style=\"font-size:8px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF\" x=\"37.1034\" y=\"156.92\"><tspan>N</tspan></text>\n",
       "<text style=\"font-size:8px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00\" x=\"319.565\" y=\"143.394\"><tspan>S</tspan></text>\n",
       "<text style=\"font-size:8px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"321.113\" y=\"118.609\"><tspan>O</tspan></text>\n",
       "<text style=\"font-size:8px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00\" x=\"363.476\" y=\"149.444\"><tspan>S</tspan></text>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# iteration 9\n",
    "mol = best_mol\n",
    "new_mols = list(mutate_mol(Chem.AddHs(mol), db_name=db_fname, return_mol=True, min_size=0, max_size=8, min_inc=-3, max_inc=3, ncores=4))\n",
    "new_mols = [Chem.RemoveHs(i[1]) for i in new_mols]\n",
    "best_mol, score = get_top(new_mols + [mol], m)\n",
    "print('molecules generated:', len(new_mols))\n",
    "print('best score:', np.round(score, 3))\n",
    "drawsvg(best_mol, highlightReplacement=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "molecules generated: 3625\n",
      "best score: 8.951\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<svg baseProfile=\"full\" height=\"300px\" version=\"1.1\" viewBox=\"0 0 400 300\" width=\"400px\" xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<!-- END OF HEADER -->\n",
       "<rect height=\"300\" style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"400\" x=\"0\" y=\"0\"> </rect>\n",
       "<path d=\"M 61.1105,166.986 L 40.6966,152.774\" style=\"fill:none;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:10px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"61.1105\" cy=\"166.986\" rx=\"6.63301\" ry=\"6.63301\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<ellipse cx=\"40.6966\" cy=\"152.774\" rx=\"6.63301\" ry=\"6.63301\" style=\"fill:#FF7F7F;fill-rule:evenodd;stroke:#FF7F7F;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2\" d=\"M 61.1105,166.986 L 52.7002,161.131\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-2\" d=\"M 52.7002,161.131 L 44.2898,155.276\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-3\" d=\"M 61.1105,166.986 L 83.6253,156.413\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 37.1034,154.462 L 27.6426,158.904\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-0\" d=\"M 27.6426,158.904 L 18.1818,163.347\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 41.048,148.628 L 41.9227,138.309\" style=\"fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-1\" d=\"M 41.9227,138.309 L 42.7974,127.989\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-4\" d=\"M 83.6253,156.413 L 104.039,170.625\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-5\" d=\"M 104.039,170.625 L 126.554,160.051\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-6\" d=\"M 125.133,162.093 L 148.389,172.222\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-6\" d=\"M 127.975,158.01 L 145.547,176.305\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-7\" d=\"M 146.968,174.263 L 169.483,163.69\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-8\" d=\"M 169.483,163.69 L 189.897,177.902\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-9\" d=\"M 190.954,180.153 L 211.354,165.077\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-9\" d=\"M 188.839,175.65 L 213.469,169.58\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-10\" d=\"M 212.411,167.329 L 232.825,181.541\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-11\" d=\"M 232.825,181.541 L 255.34,170.968\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 255.34,170.968 L 257.441,146.183\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-12\" d=\"M 260.612,167.67 L 262.083,150.321\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-13\" d=\"M 255.34,170.968 L 275.754,185.179\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-14\" d=\"M 257.441,146.183 L 279.956,135.61\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-15\" d=\"M 275.754,185.179 L 298.269,174.606\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-15\" d=\"M 277.017,179.09 L 292.777,171.689\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 279.956,135.61 L 300.37,149.821\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-16\" d=\"M 280.175,141.824 L 294.465,151.772\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-17\" d=\"M 298.269,174.606 L 300.37,149.821\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-18\" d=\"M 300.37,149.821 L 309.967,145.314\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-18\" d=\"M 309.967,145.314 L 319.565,140.807\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-19\" d=\"M 325.714,135.313 L 326.413,127.066\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-19\" d=\"M 326.413,127.066 L 327.112,118.819\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-19\" d=\"M 320.757,134.893 L 321.456,126.646\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-19\" d=\"M 321.456,126.646 L 322.155,118.399\" style=\"fill:none;fill-rule:evenodd;stroke:#FF0000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-20\" d=\"M 326.204,141.559 L 334.751,147.51\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-20\" d=\"M 334.751,147.51 L 343.298,153.46\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-21\" d=\"M 343.298,153.46 L 353.387,149.956\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-21\" d=\"M 353.387,149.956 L 363.476,146.451\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-22\" d=\"M 343.298,153.46 L 343.8,178.329\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-22\" d=\"M 348.347,157.09 L 348.698,174.498\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-23\" d=\"M 369.937,149.444 L 375.877,157.283\" style=\"fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-23\" d=\"M 375.877,157.283 L 381.818,165.123\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-24\" d=\"M 343.8,178.329 L 367.606,185.537\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-25\" d=\"M 381.818,165.123 L 367.606,185.537\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<path class=\"bond-25\" d=\"M 375.604,165.342 L 365.655,179.632\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
       "<text style=\"font-size:8px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF\" x=\"37.1034\" y=\"156.92\"><tspan>N</tspan></text>\n",
       "<text style=\"font-size:8px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00\" x=\"319.565\" y=\"143.394\"><tspan>S</tspan></text>\n",
       "<text style=\"font-size:8px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#FF0000\" x=\"321.113\" y=\"118.609\"><tspan>O</tspan></text>\n",
       "<text style=\"font-size:8px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00\" x=\"363.476\" y=\"149.444\"><tspan>S</tspan></text>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# iteration 10\n",
    "mol = best_mol\n",
    "new_mols = list(mutate_mol(Chem.AddHs(mol), db_name=db_fname, return_mol=True, min_size=0, max_size=8, min_inc=-3, max_inc=3, ncores=4))\n",
    "new_mols = [Chem.RemoveHs(i[1]) for i in new_mols]\n",
    "best_mol, score = get_top(new_mols + [mol], m)\n",
    "print('molecules generated:', len(new_mols))\n",
    "print('best score:', np.round(score, 3))\n",
    "drawsvg(best_mol, highlightReplacement=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[[0.25862068965517243, 847]]"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# calculate similarity of our best molecules to structures in the initila dataset (we use Tanimoto on Morgan binary fingerprints)\n",
    "get_sim([best_mol], fps)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAEsCAIAAABi1XKVAAAABmJLR0QA/wD/AP+gvaeTAAAgAElEQVR4nO3deVyU9b4H8O8wLMMqoIjsCgiCqShkmVsqphmYZOOGaEmNdm95zr2d03gWj93Tcodena6ezjk1Yy4sEmIKobkcNFMUKweXUNlEWUXZd2aY5Xf/eGgkYp3lWZjv+7/gmWe+EvPhtz2/H48QAgghxAUWTBeAEELDhYGFEOIMDCyEEGdgYCGEOAMDCyHEGRhYCCHOwMBCCHEGBhZCiDMwsBBCnIGBhRDiDAwshBBnYGAhhDgDAwshxBkYWAghzsDAQghxBgYWQ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mOztbKBTqQsrDw2P79u3DKQyxHAYWMpRUKqXWFixbtqyxsXHI6x89erRgwQIAEAgEFy5cMF1hDQ0NUql0+vTpuj/P4eHhUqm0vb3ddG+KTAoDC+lPoVC89tprVBZs375drVYP+ZLr169Taz49PT2///57GookPz+o6ODgQJXq5OQUFxeXnZ1Nz7sjI8LAQnqqrq5++umnqYZSYmLicF6SmppKDVo988wzDx48MHWFfXR2dqanp0dGRuomEENCQiQSSW1tLc2VIL1hYCF95Obmenh4AIC3t/fVq1eHvF6tVovFYiomRCKRUqmkociBFBYWisXi8ePHU/VYW1tHRUWlp6erVCoGq0LDgYGFRiw5OdnW1hYA5s+f//DhwyGvb2hooLZnsLS0/PXGMkxRKpVHjx5dsWIFn8+nksvX17empobputBgMLDQCFCze7qGUnd395AvuXnzJrU9g5ub2/nz501f44hVV1dLJJKAgAAXF5fnn3+e6XLQYDCw0HDV1dUtWrQIAGxsbPbt2zecl2RlZVHbM8ycObOsrMzUFRpCq9WOGTMGAB49esR0LWhAuEUyGpYbN248+eST58+f9/LyunDhwpYtWwa/nhCSkJCwatWq1tbWDRs2XL582c/Pj55S9cPj8ahnHgsLC5muBQ0IAwsN7csvv5w7d25ZWdncuXPlcvlTTz01+PVtbW0xMTE7duywsLCQSCSHDh2ixrxYbsqUKYCBxW54LiEajEaj+dOf/pSQkAAAIpHo008/HXL/qeLi4lWrVhUUFIwdO/bw4cNLliyhpVIjCA4OBoCioiKmC0EDwsBCA2psbFy3bl12dralpeXf/va37du3D/mSkydPxsbGNjc3z5gxIyMjg1tndmELi/2wS4j699NPPz355JPZ2dlubm7Z2dlDphU1aBUdHd3c3Lx27drLly9zK60AA4sTmB71R2yUnp5Onbg1a9as8vLyIa9va2ujtmegjvDSarU0FGl03d3dVlZWFhYWnZ2dTNeC+octLPQLhJCEhIS1a9d2dHTExsZeunTJ19d38JfcvXt3zpw5R48edXJyOnbsmFgs5ujmeVZWVv7+/lqt9u7du0zXgvqHgYUeo8463bFjB9VQSklJGXJ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zMzMJ554wvQljxgGFkKjzYMHD5KTk2Uy2b179wDAwsJi8eLFcXFxQqFQ9wxQHzKZ7K233uru7l62bNmXX3455KE4TMHAQmh00mq1ubm5ycnJKSkpnZ2dAODs7LxmzZo33nij9zNASqXyzTff/OKLLwBAJBL985//pGeFl34wsBAa5VpaWg4fPiyVSq9du0Z9JTw8PC4uLi4uTqFQvPzyy1euXBEIBJ9//vnmzZuZLXVIGFgImYu8vLz9+/enpqY2NzcDgJ2dnZWVVUtLi5+fX0ZGxsyZM5kucGgYWAiZF6VSmZWVJZPJzp07Fx0d3dTUdOTIEerYRPbDwELITJWWlnp6elpZWbF50KoPDCyEEGewaA0rQggNDgMLIcQZGFgIIc7AwEIIcQYGFkKIMzCwEEKcgYGFEOIMDCyEEGdgYCGEOAMDCyHEGRhYCCHOwMBCCHEGBhZCiDMwsBBCnIGBhRDiDAwshBBnYGAhhDgDAwshxBkYWAghzsDAQghxBgYWQogzMLAQQpyBgYUQ4gwMLIQQZ2BgIYQ4AwMLIcQZ/w9QUllzGHPYHwAAAABJRU5ErkJggg==\n",
      "image/svg+xml": [
       "<?xml version='1.0' encoding='iso-8859-1'?>\n",
       "<svg version='1.1' baseProfile='full'\n",
       "              xmlns='http://www.w3.org/2000/svg'\n",
       "                      xmlns:rdkit='http://www.rdkit.org/xml'\n",
       "                      xmlns:xlink='http://www.w3.org/1999/xlink'\n",
       "                  xml:space='preserve'\n",
       "width='400px' height='300px' viewBox='0 0 400 300'>\n",
       "<!-- END OF HEADER -->\n",
       "<rect style='opacity:1.0;fill:#FFFFFF;stroke:none' width='400' height='300' x='0' y='0'> </rect>\n",
       "<path class='bond-0' d='M 18.1818,242.92 L 34.6555,229.646' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-0' d='M 34.6555,229.646 L 51.1292,216.371' style='fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-1' d='M 57.2839,201.665 L 53.957,180.328' style='fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-1' d='M 53.957,180.328 L 50.6301,158.992' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2' d='M 66.1387,213.225 L 86.6143,221.141' style='fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-2' d='M 86.6143,221.141 L 107.09,229.057' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-3' d='M 107.09,229.057 L 147.542,196.46' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-4' d='M 147.542,196.46 L 195.998,215.194' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-5' d='M 195.998,215.194 L 212.472,201.919' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-5' d='M 212.472,201.919 L 228.945,188.645' style='fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-6' d='M 243.955,185.499 L 264.431,193.415' style='fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-6' d='M 264.431,193.415 L 284.906,201.331' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-19' d='M 235.1,173.939 L 231.773,152.602' style='fill:none;fill-rule:evenodd;stroke:#0000FF;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-19' d='M 231.773,152.602 L 228.446,131.266' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-7' d='M 284.906,201.331 L 292.91,252.662' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-7' d='M 296.373,207.43 L 301.976,243.362' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-20' d='M 284.906,201.331 L 325.358,168.734' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-8' d='M 292.91,252.662 L 341.366,271.396' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-9' d='M 341.366,271.396 L 381.818,238.799' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-9' d='M 340.914,258.416 L 369.231,235.598' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-10' d='M 381.818,238.799 L 373.814,187.468' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-11' d='M 373.814,187.468 L 325.358,168.734' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-11' d='M 362.799,194.349 L 328.88,181.235' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-12' d='M 325.358,168.734 L 322.031,147.398' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-12' d='M 322.031,147.398 L 318.705,126.061' style='fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-13' d='M 310.421,114.722 L 289.66,106.696' style='fill:none;fill-rule:evenodd;stroke:#CCCC00;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-13' d='M 289.66,106.696 L 268.898,98.6689' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-14' d='M 268.898,98.6689 L 260.895,47.3377' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-14' d='M 257.432,92.57 L 251.829,56.6382' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-21' d='M 268.898,98.6689 L 228.446,131.266' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-15' d='M 260.895,47.3377 L 212.439,28.6037' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-16' d='M 212.439,28.6037 L 171.987,61.2008' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-16' d='M 212.89,41.5837 L 184.574,64.4017' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-17' d='M 171.987,61.2008 L 179.99,112.532' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-18' d='M 179.99,112.532 L 228.446,131.266' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<path class='bond-18' d='M 191.006,105.651 L 224.925,118.765' style='fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1' />\n",
       "<text x='51.1292' y='218.982' style='font-size:17px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF' ><tspan>N</tspan></text>\n",
       "<text x='228.945' y='191.256' style='font-size:17px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#0000FF' ><tspan>N</tspan></text>\n",
       "<text x='310.421' y='126.061' style='font-size:17px;font-style:normal;font-weight:normal;fill-opacity:1;stroke:none;font-family:sans-serif;text-anchor:start;fill:#CCCC00' ><tspan>S</tspan></text>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<rdkit.Chem.rdchem.Mol at 0x7f680709df80>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# this is the closest molecule from the training set\n",
    "mols[847]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The designed molecule has low similarity to the training set ones and thus can be considered as novel. It has some structural patterns similar to training set compounds but it is unlikely that this compounds will be really active on the H1 receptor. At least the molecule has a very long flexible chain that can make binding entropy very unvaforable.\n",
    "This is just a demonstration how to create optimization workflows using CReM. To combine with machine learning models it is always needed to consider applicabiity domain of used models. Otherwise models can be optimized to a particular local optimum which is not reasonable from structural point of view and represent just an artefact.\n",
    "Instead of ML models any other predictive model or their combination can be used (docking, pharmacophore, etc)."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
